package com.chanjet.donkey.entity;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity @Table(name="t_tree")
public class Tree extends IdEntity {
	private String name;
	
	private Tree parent;
	private Tree tree;
	private long lft;
	private long rgt;
	private int depth;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@JoinColumn(name="parent_id") @ManyToOne
	public Tree getParent() {
		return parent;
	}
	public void setParent(Tree parent) {
		this.parent = parent;
	}
	@JoinColumn(name="tree_id") @ManyToOne
	public Tree getTree() {
		return tree;
	}
	public void setTree(Tree tree) {
		this.tree = tree;
	}
	public long getLft() {
		return lft;
	}
	public void setLft(long lft) {
		this.lft = lft;
	}
	public long getRgt() {
		return rgt;
	}
	public void setRgt(long rgt) {
		this.rgt = rgt;
	}
	public int getDepth() {
		return depth;
	}
	public void setDepth(int depth) {
		this.depth = depth;
	}
	
}
